﻿<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:controls="clr-namespace:Corina.Controls.Win;assembly=Corina.Controls.Win"
      xmlns:converters="clr-namespace:Corina.Converters.Win;assembly=Corina.Converters.Win"
      xmlns:localViewmodel="clr-namespace:Corina.Addins.NatUPnP"
      FontSize="14">
    <Page.DataContext>
        <localViewmodel:NatUPnPViewmodel />
    </Page.DataContext>
    <Page.Resources>
        <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
        <converters:BooleanToVisibilityInverseConverter x:Key="BooleanToVisibilityInverseConverter" />
        <Style TargetType="TextBlock">
            <Setter Property="VerticalAlignment" Value="Center" />
        </Style>
    </Page.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <DataGrid ItemsSource="{Binding UPnPCollection}" />

        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="60" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="60" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <TextBlock Text="外网端口：" />
            <TextBox Grid.Column="1" Text="{Binding Eport, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
            <TextBlock Grid.Column="2" Text="内网端口：" />
            <TextBox Grid.Column="3" Text="{Binding Iport, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
            <TextBlock Grid.Column="4" Text="描述：" />
            <TextBox Grid.Column="5" Text="{Binding Description, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
            <TextBlock Grid.Column="6">
                <Run Text="IP地址：" />
                <Run Text="{Binding IPAddress, Mode=OneWay}" />
            </TextBlock>
            <Button Grid.Column="7"
                    Command="{Binding PenetrateCommand}"
                    Content="开启" />

        </Grid>
    </Grid>
</Page>